package org.springboot.base.demo.controller;

import org.springboot.base.MyException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ZJL
 * @DateTime 2019年2月22日 下午2:29:48
 * 
 **/
@RestController
@RequestMapping(value = "/exce")
public class ExceptionController {

	@RequestMapping("/demo1")
	public Object demo1() throws Exception {
		throw new Exception("我处理出错了！");
	}

	@RequestMapping("/demo2")
	public Object demo2() throws Exception {
		throw new MyException("我处理出错了！22222222");
	}

	@RequestMapping("/demo3")
	public Object demo3() throws Exception {
		try {
			int a = 1 / 0;
		} catch (Exception e) {
			throw new MyException("我处理出错了！3333333333");
		}
		return null;
	}
}
